package com.pb.mapper;

import com.pb.pojo.Subject;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.time.LocalDate;

@Mapper
public interface SubjectMapper {
    @Insert("insert into module(moduleNo,moduleName,semesterDisponivel,moduleCoordinatorEmpNo,departmentNo) values(null,#{moduleName},#{semesterDisponivel},#{moduleCoordinatorEmpNo},#{departmentNo})")
    public void insert(Subject subject);

    public List<Subject> list(String name);

    @Select("select * from module where moduleNo = #{id}")
    public Subject getInfo(Integer id);

    public void update(Subject subject);

    @Delete("delete from module where moduleNo = #{id}")
    public void deleteById(Integer id);

    @Select("select * from module")
    public List<Subject> findAll();
}
